﻿using System;
using System.Web.UI;

namespace VLXD
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (Request.QueryString["page"])
            {
                case "chonptthanhtoan":
                    Page.Title = "Chọn phương thức thanh toán";
                    PlaceHolder1.Controls.Add(LoadControl("uc/ChonPTThanhToan.ascx"));
                    break;
                case "ThongTinNguoiDung":
                    PlaceHolder1.Controls.Add(LoadControl("uc/ThongTinNguoiDung.ascx"));
                    break;
                case "login":
                    PlaceHolder1.Controls.Add(LoadControl("uc/Login.ascx"));
                    break;
                case "logout":
                    Session["admin"] = null;
                    Session["TenDayDu"] = null;
                    Session["Email"] = null;
                    Response.Redirect("default.aspx?page=login");
                    break;
                case "QuenMatKhau":
                    PlaceHolder1.Controls.Add(LoadControl("uc/QuenMatKhau.ascx"));
                    break;
                case "register":
                    Page.Title = "Đăng ký thành viên";
                    PlaceHolder1.Controls.Add(LoadControl("uc/DangKy.ascx"));
                    break;
                case "danhmuccha":
                    PlaceHolder1.Controls.Add(LoadControl("uc/DanhMucCha.ascx"));
                    break;
                case "DoiMatKhau":
                    PlaceHolder1.Controls.Add(LoadControl("uc/DoiMatKhau.ascx"));
                    break;
                case "danhmuc":
                    PlaceHolder1.Controls.Add(LoadControl("uc/DanhMuc.ascx"));
                    break;
                case "chitietsanpham":
                    PlaceHolder1.Controls.Add(LoadControl("uc/chitietsanpham.ascx"));
                    break;
                case "cart":
                    PlaceHolder1.Controls.Add(LoadControl("uc/cart.ascx"));
                    break;
                case "checkout":
                    Page.Title = "Gửi đơn hàng";
                    PlaceHolder1.Controls.Add(LoadControl("uc/checkout.ascx"));
                    break;
                case "lienhe":
                    PlaceHolder1.Controls.Add(LoadControl("uc/LienHe.ascx"));
                    break;
                case "end":
                    PlaceHolder1.Controls.Add(LoadControl("uc/end.ascx"));
                    break;
                case "timkiem":
                    Page.Title = "Tìm kiếm";
                    PlaceHolder1.Controls.Add(LoadControl("uc/timkiem.ascx"));
                    break;
                case "tintuc":
                    Page.Title = "Tin Tức";
                    PlaceHolder1.Controls.Add(LoadControl("uc/TinTuc.ascx"));
                    break;
                case "chitiettintuc":
                    PlaceHolder1.Controls.Add(LoadControl("uc/TinTuc_ChiTiet.ascx"));
                    break;
                default:
                    PlaceHolder1.Controls.Add(LoadControl("uc/index_list.ascx"));
                    break;
            }
        }
    }
}